import orm
# from orm import write_db
# from orm import * #*代表所有
def login():
    tag=0
    name=input("请输入用户名：")
    pwd=input("请输入密码：")
    sql=f"select * from qiandaohu where username='{name}' and password={pwd}"
    data=orm.read_db(sql)
    if data !=():
        tag=1
    return tag
def register():
    name = input("请输入注册用户名：")
    pwd = input("请输入注册密码：")
    sql=f"select * from qiandaohu where username='{name}'"
    data=orm.read_db(sql)
    if data ==():
        sql = f"insert into qiandaohu values(null,'{name}',{pwd})"
        orm.wirte_db(sql)
        print("注册成功！！！")
    else:
        print("用户名已存在！！！")
if __name__ == '__main__':
    print(register())